The present invention relates to an apparatus and method for sharing and reusing a section of multisample and/or antialiasing memory amongst multiple displays.
Computer graphics is used in a wide variety of applications, such as in business, science, animation, simulation, computer-aided design, process control, electronic publication, gaming, medical diagnosis, etc. In an effort to portray a more realistic real-world representation, three dimensional objects are transformed into models having the illusion of depth for display onto a two-dimensional computer screen. This is accomplished by using a number of polygons to initially form a basic surface xe2x80x9cmeshxe2x80x9d representation of a three-dimensional object. Next, texture is selectively applied to the polygons to give the object the appearance of solidity. In addition, hidden or obscured surfaces, which are normally not visible, are eliminated from view. Finally, lighting, shading, shadowing, translucency, and blending effects are applied. The end result is a three-dimensional image rendered for display.
Although the general principles behind generating three-dimensional images are well known, it nevertheless requires specialized know-how in order to generate highly detailed, realistic, and visually appealing three-dimensional graphics scenes. One of the problems relates to the way images are eventually displayed on a computer screen. A computer screen is physically comprised of millions of picture elements, known as xe2x80x9cpixels.xe2x80x9d For example, high resolution displays typically contain an array of 1280xc3x971024 pixels. Each of these million pixels is instructed to display a certain color. The computer system generates a color value (e.g., red, green, and bluexe2x80x94RGB) for each of the individual pixels. The colors emanating from each of the million pixels are what eventually form the three-dimensional images.
However, during a scan conversion process, instances often arise whereby a pixel belongs to more than one polygon. In other words, a pixel may be split between two or more polygons. In which case, assigning the pixel a color corresponding to just one of the polygons, and not to any of the other polygon(s), is inaccurate because each of the overlapping polygonal portions contribute to that pixel""as color. These pixel discrepancies produce unwanted visual artifacts and seriously degrade the generated three-dimensional images.
In an effort to minimize these discrepancies and artifacts, antialiasing (e.g.; A buffer, fragment-based techniques, and other shared storage techniques) have been developed. One technique known as xe2x80x9cmultisampling,xe2x80x9d or multisample anti-aliasing is particularly effective. Rather than basing a pixel""as characteristics according to its centerpoint, multiple points dispersed throughout the pixel are used to xe2x80x9csamplexe2x80x9d the characteristics at those particular locations. The characteristics for each of the multiple sample points are then averaged, weighted, or otherwise combined to produce a final result. It is this final result which is rendered for display. For example, suppose that a pixel is covered by three polygons. The pixel could have eight sample points dispersed therein. Three sample points might fall in the first polygon; two sample points might fall in the second polygon; and three sample points might fall in the third polygon. In this example, the color value for the pixel would be the average of three-eighths of the color of the first polygon, two-eighths of the color of the second polygon, and three-eighths of the color of the third polygon. By rendering multisampled pixel values, a more accurate, smoother, and visually appealing three-dimensional display is produced.
Unfortunately, one drawback to using multisampling is that a great amount of additional memory is required to store the multisample point values. For instance, if eight sample points per pixel are used for multisampling, the extra amount of memory required to handle these sample points is eight times greater than that for traditional non-multisampled pixel rasterization. Moreover, utilizing more sample points per pixel yields better results because of its finer resolution and precision. However, having more sample points correspondingly requires that much more memory be available. Furthermore, a sample point often has more than just a corresponding color value. A single sample point typically has eight bits per color (RGBA)=32 bits; plus 32 bits of depth (Z); and 8 stencil bits. Thus, multisampled memory is considered to be xe2x80x9cdeepxe2x80x9d in that many different values must be stored for each sample point of each of the pixels. In addition, there are some applications, such as multi-channel visual simulation and location-based entertainment (e.g., flight simulators), whereby extremely large amounts of multisample buffer memory is needed for rendering each of the channels or display screens.
Incorporating the requisite amount of multisampling memory and hardware is cost prohibitive for most general applications. Consequently, multisampling has hitherto tended to be limited to expensive, high-end graphics workstations and computers. Thus, there is a need for a more economical mechanism for providing multisampling.
The present invention provides one unique solution whereby the amount of memory required for multisampling is minimized. This enables the enhanced benefits conferred by multisampling to be achieved on much less expensive computing platforms. The present invention accomplishes this by having a portion of multisampling memory be shared or reused across one or more display areas. Rather than having one huge multisampling memory for storing all of the multisample point values for all of the display pixels, the present invention contemplates reusing a relatively small piece of multisample memory to perform the multisampling for various displays.
The present invention pertains to a computer-implemented method for generating three-dimensional images by reusing or sharing multisample memory. Pixels corresponding to a first region of the overall display are multisampled. The multisampled pixel values corresponding to this first region of the display are stored in a multisample and/or antialiasing memory. Final pixel values corresponding to the first region of the display are generated based on their multisampled values and then stored in the first region of a traditional frame buffer. Next, multisampling is performed on those pixels belonging to a second region of the overall display. The same multisample memory is reused in order to store the multisampled pixel values corresponding to the second region of the display. The final pixel values corresponding to the second region of the display are then stored in the frame buffer. This process is repeated until multisampling has been performed over the entire display area. Meanwhile, pixel values from the frame buffer are being scanned out for display.
Thereby, the same piece of multisample memory is shared between the first and second region of the display, which minimizes the amount of multisample memory that is needed. Rather than having one large, all-encompassing multisample memory which covers the entire display, the present invention contemplates utilizing a smaller multisample memory which is big enough to only cover one region of the display. This smaller multisample memory can be reused to successively perform multisampling on different sections of the overall display until the entire display area has been multisampled.